home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / svgabg31.zip / NOTES32K.SVG < prev    next >
Text File  |  1991-12-06  |  2KB  |  65 lines

  1. SuperVGA 32768 BGI driver 
  2. Version 1.0
  3. December 6, 1991
  4.  
  5. This is the first version of my SuperVGA 32768 BGI driver.  All functions
  6. have been implemented, but there may still be bugs.
  7.  
  8. Note:   Paging, palette functions, and the mouse cursor will not work with 
  9.     this driver.
  10.  
  11.   Using the HiColor driver:
  12.  
  13.     Implementing the 32768 color driver involved several hacks, as
  14.     the BGI interface only supports 8-bit color values, but the driver
  15.     needed support for 15-bit color values.  The procedures that needed
  16.     to be changed were those that accepted color values, (SetColor,
  17.     SetFillStyle, SetFillPattern, PutPixel and Floodfill)  and those 
  18.     that return color values (GetColor and GetPixel).
  19.     As the HiColor modes do not support palettes, I decided to use
  20.     the SetRgbPalette call to set colors, as it accepts values for the 
  21.     R,G and B components of the color.
  22.  
  23.     The format of a pixel in the HiColor modes is:
  24.         -Byte 1- -Byte 0-
  25.         xRRRRRGG GGGBBBBB
  26.  
  27.     Several new functions are defined to make the color selection easier.
  28.     In addition, the macro RGB(rv,gv,bv) has been defined.  It packs
  29.     the R, G and B values into the format described above and returns the
  30.     combined color.
  31.  
  32.     * RealDrawColor(); - Sets the current drawing color.
  33.       Usage:
  34.         setcolor(RealDrawColor(RGB(rval,gval,bval)); - HiColor modes
  35.         setcolor(RealDrawColor(cval)); - (suggested for any other driver)
  36.  
  37.     * RealFillColor(); - Sets the current fill color.
  38.       Usage:
  39.         setfillstyle(fillstyle,RealFillColor(RGB(rval,gval,bval)));
  40.         setfillstyle(fillstyle,RealFillColor(cval));
  41.         setfillpattern(fillpat,RealFillColor(RGB(rval,gval,bval)));
  42.         setfillpattern(fillpat,RealFillColor(cval));
  43.  
  44.     * RealColor(); - For putpixel, sets the color of the pixel
  45.                - For floodfill, sets the color of the boundary
  46.         putpixel(x,y,RealColor(RGB(rval,gval,bval)));
  47.         putpixel(x,y,RealColor(cval));
  48.         floodfill(x,y,RealColor(RGB(rval,gval,bval)));
  49.         floodfill(x,y,RealColor(cval));
  50.  
  51.     * GetPixel normally only returns an 8-bit value.  However, the
  52.       value returned from the BGI driver is a 16-bit value in DX (the 
  53.       BGI kernel loads the value into AX and clears the upper 8 bits),
  54.       so to read the value of a pixel:
  55.  
  56.       In Pascal:
  57.         Color := getpixel(x,y);
  58.         inline($89/$56/<Color);  (* Loads 15-bit color value *)
  59.  
  60.       In C:
  61.         Color = getpixel(x,y);
  62.         Color = _DX;
  63.       
  64.  
  65.